﻿@model CustomerSettingsModel
<script>
    $(document).ready(function () {
        $("#@Html.IdFor(model => model.AddressSettings.CountryEnabled)").click(toggleAddressCountryFormField);
        $("#@Html.IdFor(model => model.AddressSettings.CompanyEnabled)").click(toggleAddressRequiredFormField);
        $("#@Html.IdFor(model => model.AddressSettings.VatNumberEnabled)").click(toggleAddressRequiredFormField);
        $("#@Html.IdFor(model => model.AddressSettings.StreetAddressEnabled)").click(toggleAddressRequiredFormField);
        $("#@Html.IdFor(model => model.AddressSettings.StreetAddress2Enabled)").click(toggleAddressRequiredFormField);
        $("#@Html.IdFor(model => model.AddressSettings.ZipPostalCodeEnabled)").click(toggleAddressRequiredFormField);
        $("#@Html.IdFor(model => model.AddressSettings.CityEnabled)").click(toggleAddressRequiredFormField);
        $("#@Html.IdFor(model => model.AddressSettings.PhoneEnabled)").click(toggleAddressRequiredFormField);
        $("#@Html.IdFor(model => model.AddressSettings.FaxEnabled)").click(toggleAddressRequiredFormField);

        toggleAddressCountryFormField();
        toggleAddressRequiredFormField();
    });

    function toggleAddressCountryFormField() {
        if ($('#@Html.IdFor(model => model.AddressSettings.CountryEnabled)').is(':checked')) {
            $('#pnlAddressStateProvinceEnabled').show();
        }
        else {
            $('#pnlAddressStateProvinceEnabled').hide();
        }
    }

    function toggleAddressRequiredFormField() {
        if ($('#@Html.IdFor(model => model.AddressSettings.CompanyEnabled)').is(':checked')) {
            $('#pnlAddressCompanyRequired').show();
        }
        else {
            $('#pnlAddressCompanyRequired').hide();
        }
        if ($('#@Html.IdFor(model => model.AddressSettings.VatNumberEnabled)').is(':checked')) {
            $('#pnlAddressVatNumberRequired').show();
        }
        else {
            $('#pnlAddressVatNumberRequired').hide();
        }

        if ($('#@Html.IdFor(model => model.AddressSettings.StreetAddressEnabled)').is(':checked')) {
            $('#pnlAddressStreetAddressRequired').show();
        }
        else {
            $('#pnlAddressStreetAddressRequired').hide();
        }

        if ($('#@Html.IdFor(model => model.AddressSettings.StreetAddress2Enabled)').is(':checked')) {
            $('#pnlAddressStreetAddress2Required').show();
        }
        else {
            $('#pnlAddressStreetAddress2Required').hide();
        }

        if ($('#@Html.IdFor(model => model.AddressSettings.ZipPostalCodeEnabled)').is(':checked')) {
            $('#pnlAddressZipPostalCodeRequired').show();
        }
        else {
            $('#pnlAddressZipPostalCodeRequired').hide();
        }

        if ($('#@Html.IdFor(model => model.AddressSettings.CityEnabled)').is(':checked')) {
            $('#pnlAddressCityRequired').show();
        }
        else {
            $('#pnlAddressCityRequired').hide();
        }

        if ($('#@Html.IdFor(model => model.AddressSettings.PhoneEnabled)').is(':checked')) {
            $('#pnlAddressPhoneRequired').show();
        }
        else {
            $('#pnlAddressPhoneRequired').hide();
        }

        if ($('#@Html.IdFor(model => model.AddressSettings.FaxEnabled)').is(':checked')) {
            $('#pnlAddressFaxRequired').show();
        }
        else {
            $('#pnlAddressFaxRequired').hide();
        }
    }
</script>
<div class="form-horizontal">
<div class="form-body">
<div class="form-group">
    <div class="note note-info">
        @Loc["Admin.Settings.Customer.AddressFormFields.Description"]
    </div>
</div>
<div class="form-group">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.NameEnabled" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.NameEnabled"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.NameEnabled"></span>
    </div>
</div>
<div class="form-group">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.AddressTypeEnabled" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.AddressTypeEnabled"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.AddressTypeEnabled"></span>
    </div>
</div>
<div class="form-group">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.CompanyEnabled" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.CompanyEnabled"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.CompanyEnabled"></span>
    </div>
</div>
<div class="form-group" id="pnlAddressCompanyRequired">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.CompanyRequired" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.CompanyRequired"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.CompanyRequired"></span>
    </div>
</div>
<div class="form-group">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.VatNumberEnabled" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.VatNumberEnabled"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.VatNumberEnabled"></span>
    </div>
</div>
<div class="form-group" id="pnlAddressVatNumberRequired">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.VatNumberRequired" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.VatNumberRequired"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.VatNumberRequired"></span>
    </div>
</div>
<div class="form-group">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.StreetAddressEnabled" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.StreetAddressEnabled"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.StreetAddressEnabled"></span>
    </div>
</div>
<div class="form-group" id="pnlAddressStreetAddressRequired">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.StreetAddressRequired" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.StreetAddressRequired"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.StreetAddressRequired"></span>
    </div>
</div>
<div class="form-group">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.StreetAddress2Enabled" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.StreetAddress2Enabled"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.StreetAddress2Enabled"></span>
    </div>
</div>
<div class="form-group" id="pnlAddressStreetAddress2Required">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.StreetAddress2Required" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.StreetAddress2Required"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.StreetAddress2Required"></span>
    </div>
</div>
<div class="form-group">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.ZipPostalCodeEnabled" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.ZipPostalCodeEnabled"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.ZipPostalCodeEnabled"></span>
    </div>
</div>
<div class="form-group" id="pnlAddressZipPostalCodeRequired">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.ZipPostalCodeRequired" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.ZipPostalCodeRequired"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.ZipPostalCodeRequired"></span>
    </div>
</div>
<div class="form-group">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.CityEnabled" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.CityEnabled"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.CityEnabled"></span>
    </div>
</div>
<div class="form-group" id="pnlAddressCityRequired">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.CityRequired" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.CityRequired"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.CityRequired"></span>
    </div>
</div>
<div class="form-group">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.CountryEnabled" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.CountryEnabled"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.CountryEnabled"></span>
    </div>
</div>
<div class="form-group" id="pnlAddressStateProvinceEnabled">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.StateProvinceEnabled" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.StateProvinceEnabled"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.StateProvinceEnabled"></span>
    </div>
</div>
<div class="form-group">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.PhoneEnabled" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.PhoneEnabled"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.PhoneEnabled"></span>
    </div>
</div>
<div class="form-group" id="pnlAddressPhoneRequired">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.PhoneRequired" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.PhoneRequired"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.PhoneRequired"></span>
    </div>
</div>
<div class="form-group">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.FaxEnabled" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.FaxEnabled"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.FaxEnabled"></span>
    </div>
</div>
<div class="form-group" id="pnlAddressFaxRequired">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.FaxRequired" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.FaxRequired"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.FaxRequired"></span>
    </div>
</div>
<div class="form-group">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.NoteEnabled" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.NoteEnabled"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.NoteEnabled"></span>
    </div>
</div>
<div class="form-group">
    <div class="col-8 col-md-4 col-sm-4 text-right">
        <admin-label asp-for="AddressSettings.DisallowUsersToChangeEmail" class="control-label"/>
    </div>
    <div class="col-4 col-md-8 col-sm-8">
        <label class="mt-checkbox mt-checkbox-outline control control-checkbox">
            <admin-input asp-for="AddressSettings.DisallowUsersToChangeEmail"/>
            <div class="control__indicator"></div>
        </label>
        <span asp-validation-for="AddressSettings.DisallowUsersToChangeEmail"></span>
    </div>
</div>
</div>
</div>